import ash from "@ash.ts/ash";
import { WaitForStart } from "../component/WaitForStart";
import { Display } from "../component/Display";
import { Position } from "../component/Position";
import { GameState } from "../component/GameState";
import { Asteroid } from "../component/Asteroid";
import { Collision } from "../component/Collision";
import { Animation } from "../component/Animation";
import { Bullet } from "../component/Bullet";
import { DeathThroes } from "../component/DeathThroes";
import { GunControls } from "../component/GunControls";
import { Gun } from "../component/Gun";
import { Hud } from "../component/Hud";
import { MotionControls } from "../component/MotionControls";
import { Motion } from "../component/Motion";
import { Spaceship } from "../component/Spaceship";

export const AnimationNode = ash.defineNode({
    animation: Animation,
}, 'AnimationNode');
export type AnimationNode = InstanceType<typeof AnimationNode>;

export const AsteroidCollisionNode = ash.defineNode({
    asteroid: Asteroid,
    position: Position,
    collision: Collision
    // audio: Audio,
}, 'AsteroidCollisionNode');
export type AsteroidCollisionNode = InstanceType<typeof AsteroidCollisionNode>;

// export const AudioNode = defineNode({
//     audio: Audio,
// }, 'AudioNode');
// export type AudioNode = InstanceType<typeof AudioNode>;

export const BulletAgeNode = ash.defineNode({
    bullet: Bullet,
}, 'BulletAgeNode');
export type BulletAgeNode = InstanceType<typeof BulletAgeNode>;

export const BulletCollisionNode = ash.defineNode({
    bullet: Bullet,
    position: Position,
    collision: Collision,
}, 'BulletCollisionNode');
export type BulletCollisionNode = InstanceType<typeof BulletCollisionNode>;

export const DeathThroesNode = ash.defineNode({
    death: DeathThroes,
}, 'DeathThroesNode');
export type DeathThroesNode = InstanceType<typeof DeathThroesNode>;

export const GameNode = ash.defineNode({
    state: GameState,
}, 'GameNode');
export type GameNode = InstanceType<typeof GameNode>;

export const GunControlNode = ash.defineNode({
    control: GunControls,
    gun: Gun,
    position: Position,
    // audio: Audio,
}, 'GunControlNode');
export type GunControlNode = InstanceType<typeof GunControlNode>;

export const HudNode = ash.defineNode({
    state: GameState,
    hud: Hud,
}, 'HudNode');
export type HudNode = InstanceType<typeof HudNode>;

export const MotionControlNode = ash.defineNode({
    control: MotionControls,
    position: Position,
    motion: Motion,
}, 'MotionControlNode');
export type MotionControlNode = InstanceType<typeof MotionControlNode>;

export const MovementNode = ash.defineNode({
    position: Position,
    motion: Motion,
}, 'MovementNode');
export type MovementNode = InstanceType<typeof MovementNode>;

export const RenderNode = ash.defineNode({
    position: Position,
    display: Display,
}, 'RenderNode');
export type RenderNode = InstanceType<typeof RenderNode>;

export const SpaceshipCollisionNode = ash.defineNode({
    spaceship: Spaceship,
    position: Position,
    collision: Collision,
    motion: Motion
    // audio: Audio,
}, 'SpaceshipCollisionNode');
export type SpaceshipCollisionNode = InstanceType<typeof SpaceshipCollisionNode>;

export const SpaceshipNode = ash.defineNode({
    spaceship: Spaceship,
    position: Position,
}, 'SpaceshipNode');
export type SpaceshipNode = InstanceType<typeof SpaceshipNode>;

export const WaitForStartNode = ash.defineNode({
    wait: WaitForStart,
}, 'WaitForStartNode');
export type WaitForStartNode = InstanceType<typeof WaitForStartNode>;